<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title> 프로필(나중에 사진올리기에도 사용할 수 있을지도 모름) </title>
  <style type="text/css">
  	#profilePicture{
  		height: 300px; width: 300px;
  		border: none;
  	}
  </style>
  <script src="../js/jquery-2.1.1.js"></script>
    <script>

        $(document).ready(function(){
        	changeProfile();
        	setState();
        	gohome();
        });
        function changeProfile() {
			$('#changeProfile').on('click',function(){
				window.open("/mamma/sanghyun/profilePictureUpdate.action", "프로필 사진 바꾸기", "width=500, height=500, location=no,top=200,left=300");
				
			});
		}
        function setState(){
			var state = "${memberVo.hometown}";
				$('option[value='+state+']').attr('selected',"selected");
        }
        function gohome() {
        	$('#gohome').on('click',function(){
        	window.location.href="/mamma/sanghyun/backHome.action";
        	});
		}
  	
  </script>

</head>

    <form id="form1" method="post" enctype="multipart/form-data" action="/mamma/sanghyun/updateProfile.action" >
        
       	<s:if test="%{savedFile != null || memberVo.profile_id != null}">
			<img id="profilePicture" src="../photoData/${savedFile}" />
		</s:if>
		<s:else>
			<img id="profilePicture" src="../image/profile.png" />
		</s:else>
        <input type="button" id="changeProfile" value="프로필 사진 바꾸기">
       	<br/>
       
    </form>
    <form action="profileUpdate.action" method="post" id="form2">
    	<input type="hidden" value="<s:property value='memberVo.email'/>" name="memberVo.email"> 
	 	별&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;명:<input type="text" value="<s:property value='memberVo.nickname'/>" id="nickname" name="memberVo.nickname"><br/>
		비밀번호:<input type="password"  id="password" name="memberVo.password"><br/>
		거주지역:
		<select id="state" name="memberVo.hometown">
			<option value="서울">서울</option>
			<option value="경기">경기</option>
			<option value="인천">인천</option>
			<option value="강원">강원</option>
			<option value="충남">충남</option>
			<option value="충북">충북</option>
			<option value="대전">대전</option>
			<option value="세종">세종</option>
			<option value="부산">부산</option>
			<option value="울산">울산</option>
			<option value="대구">대구</option>
			<option value="경북">경북</option>
			<option value="경남">경남</option>
			<option value="광주">광주</option>
			<option value="전북">전북</option>
			<option value="전남">전남</option>
			<option value="제주">제주</option>
		</select>&nbsp;&nbsp;
						<br/>
						<br/>
						<br/>
		<input type="submit" value="회원 정보 수정">
		<input type="button" value="취소하고 홈으로" id="gohome">
    </form>
    
     
</body>
</html>